import 'package:backend.core/core/domain/entities/api/web/api_web_bank_card_type.dart';
import 'package:equatable/equatable.dart';

const kApiWebBankCardTypeVisaValue = 'visa';
const kApiWebBankCardTypeMastercardValue = 'mastercard';
const kApiWebBankCardTypeMirValue = 'mir';
const kApiWebBankCardTypeUnionPayValue = 'unionPay';
const kApiWebBankCardTypeJcbValue = 'jcb';
const kApiWebBankCardTypeAmericanExpressValue = 'american_express';
const kApiWebBankCardTypeDinersClubValue = 'diners_club';
const kApiWebBankCardTypeDiscoverCardValue = 'discover_card';
const kApiWebBankCardTypeInstaPaymentValue = 'insta_payment';
const kApiWebBankCardTypeInstaPaymentTMValue = 'insta_payment_tm';
const kApiWebBankCardTypeLaserValue = 'laser';
const kApiWebBankCardTypeDankortValue = 'dankort';
const kApiWebBankCardTypeSoloValue = 'solo';
const kApiWebBankCardTypeSwitchValue = 'switch';
const kApiWebBankCardTypeUnknownValue = 'unknown';

class ApiWebBankCardTypeDto extends Equatable {
  const ApiWebBankCardTypeDto._internal({
    required this.bankCardTypeString,
  });

  final String bankCardTypeString;

  @override
  List<Object?> get props {
    return [
      bankCardTypeString,
    ];
  }

  factory ApiWebBankCardTypeDto.fromEntity(ApiWebBankCardType bankCardType) {
    late final String bankCardTypeString;

    if (bankCardType == ApiWebBankCardType.visa) {
      bankCardTypeString = kApiWebBankCardTypeVisaValue;
    } else if (bankCardType == ApiWebBankCardType.mastercard) {
      bankCardTypeString = kApiWebBankCardTypeMastercardValue;
    } else if (bankCardType == ApiWebBankCardType.mir) {
      bankCardTypeString = kApiWebBankCardTypeMirValue;
    } else if (bankCardType == ApiWebBankCardType.unionPay) {
      bankCardTypeString = kApiWebBankCardTypeUnionPayValue;
    } else if (bankCardType == ApiWebBankCardType.jcb) {
      bankCardTypeString = kApiWebBankCardTypeJcbValue;
    } else if (bankCardType == ApiWebBankCardType.americanExpress) {
      bankCardTypeString = kApiWebBankCardTypeAmericanExpressValue;
    } else if (bankCardType == ApiWebBankCardType.dinersClub) {
      bankCardTypeString = kApiWebBankCardTypeDinersClubValue;
    } else if (bankCardType == ApiWebBankCardType.discoverCard) {
      bankCardTypeString = kApiWebBankCardTypeDiscoverCardValue;
    } else if (bankCardType == ApiWebBankCardType.instaPayment) {
      bankCardTypeString = kApiWebBankCardTypeInstaPaymentValue;
    } else if (bankCardType == ApiWebBankCardType.instaPaymentTM) {
      bankCardTypeString = kApiWebBankCardTypeInstaPaymentTMValue;
    } else if (bankCardType == ApiWebBankCardType.laser) {
      bankCardTypeString = kApiWebBankCardTypeLaserValue;
    } else if (bankCardType == ApiWebBankCardType.dankort) {
      bankCardTypeString = kApiWebBankCardTypeDankortValue;
    } else if (bankCardType == ApiWebBankCardType.solo) {
      bankCardTypeString = kApiWebBankCardTypeSoloValue;
    } else if (bankCardType == ApiWebBankCardType.switchCard) {
      bankCardTypeString = kApiWebBankCardTypeSwitchValue;
    } else if (bankCardType == ApiWebBankCardType.unknown) {
      bankCardTypeString = kApiWebBankCardTypeUnknownValue;
    }

    return ApiWebBankCardTypeDto._internal(
      bankCardTypeString: bankCardTypeString,
    );
  }

  @override
  String toString() {
    return bankCardTypeString;
  }
}
